# -*- coding: utf-8 -*-
'''
Created on 15-11-2012

@author: LONG HOANG GIANG
'''

from Model.storymodelv2 import StoryModel
from Model.basemodel import SQLiteDatabase

def insert(index=[]):
    smodel1 = StoryModel(SRC)
    smodel1.open()
    smodel2 = StoryModel(DEST)
    smodel2.open(True)
    
    item = smodel1.get_story_by_id(25)
#    print item[0]
    smodel1.upate_story("Hồi 2 - Chương 7", item[3], item[0])
#    print item
    
    stories = smodel1.get_all_stories()
    for story in stories:
        print story
    
    smodel2.close()
    smodel1.close()

if __name__ == '__main__':
    
    SRC = "f:/longhoanggiang/database/tongtaitoiactaytroi"
    DEST = "f:/longhoanggiang/database/tongtaitoiactaytroi-dest"
    
    
    insert([])